﻿<%@ Page Language="C#" MasterPageFile="~/Administrator/Admin.master" AutoEventWireup="true"
    Inherits="Administrator_AdminProductImages" Title="Quản trị ảnh sản phẩm" CodeBehind="AdminProductImages.aspx.cs" %>

<%@ Register Src="~/Administrator/Controls/PaggingControl.ascx" TagName="PaggingControl"
    TagPrefix="EHT" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <h1>
        <asp:Label ID="lbAdminProductImages" runat="server" Text="Danh sách ảnh sản phẩm"></asp:Label>
    </h1>
    <p class="submitButton">
        <asp:Button ID="btnBack" runat="server" Text="Quay lại sản phẩm" CssClass="btn_action"
            OnClick="btnBack_Click" />
        <asp:Button ID="btnAdd" runat="server" Text="Thêm Hình Ảnh" OnClick="btnAdd_Click"
            CssClass="btn_action" />
    </p>
    <asp:Repeater ID="rpProductImages" runat="server" OnItemCommand="rpProductImages_ItemCommand">
        <HeaderTemplate>
            <table cellspacing="0" cellpadding="0" class="data-table">
                <thead>
                    <tr>
                        <th class="actions delete">
                            STT
                        </th>
                        <th class="actions edit">
                            Sửa
                        </th>
                        <th class="actions delete">
                            Xóa
                        </th>
                        <th>
                            Hình Ảnh
                        </th>
                        <th  class="number_of_order">
                            Thứ tự
                            <asp:ImageButton ID="ibtnSaveAll" ImageUrl="Templates/Images/save_all.jpg" Height="20"
                                Width="20" OnClientClick="return confirm('Bạn muốn lưu ?');" runat="server" BorderStyle="None"
                                CommandName="save_all" />
                        </th>
                        <th class="publish">
                            Hiển thị
                        </th>
                    </tr>
                </thead>
                <tbody>
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td>
                    <%#Eval("IndexId")%>
                </td>
                <td class="actions edit">
                    <a href='AdminProductImageIU.aspx?HinhAnhID=<%#Eval("HinhAnhID")%>&SanPhamID=<%#Eval("SanPhamID")%>'>
                        <img alt="Edit" src="Templates/Images/Edit.png"></a>
                    <asp:Literal ID="ltrHinhAnhID" runat="server" Visible="false" Text='<%#Eval("HinhAnhID")%>'></asp:Literal>
                </td>
                <td class="actions delete">
                    <a href='#'>
                        <asp:ImageButton ID="btnDelete" ToolTip="Delete" CommandName="delete1" runat="server"
                            ImageUrl="Templates/Images/Delete.png" CommandArgument='<%#Eval("HinhAnhID")%>'
                            OnClientClick="return confirm('Bạn có muốn xóa hình ảnh này không ?');  " />
                </td>
                <th>
                    <img height="80" width="60" src='../ImageDatas/Products/<%#Eval("HinhAnhUrl")%>'
                        alt="" />
                </th>
                <td>
                    <asp:TextBox ID="txtNumberOfOrder" Width="30" runat="server" Text='<%#Eval("NumberOfOrder")%>'></asp:TextBox>
                    <asp:ImageButton Width="16" Height="16" ID="btnSaveNumberOfOrder" CommandName="change_number_of_order"
                        CommandArgument='<%#Eval("HinhAnhID") %>' ImageUrl="Templates/Images/save.jpg"
                        runat="server" />
                </td>
                <td>
                    <asp:CheckBox ID="ckPublish" runat="server" Checked='<%#Eval("Publish")%>' Visible="false" />
                    <asp:ImageButton Width="16" Height="16" ID="btnPublish" CommandName="publish" CommandArgument='<%#Eval("HinhAnhID") %>'
                        ImageUrl="Templates/Images/btncheck.png" runat="server" />
                </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </tbody> </table>
        </FooterTemplate>
    </asp:Repeater>
    <p>
        <EHT:paggingcontrol id="PaggingControl1" runat="server" pageurl="AdminProductImages.aspx"
            pagesize="10" />
    </p>
</asp:Content>
